import request from '@/utils/request'

// 查询订单详情列表
export function listOrderInfo(query) {
  return request({
    url: '/orderInfo/orderInfo/list',
    method: 'get',
    params: query
  })
}

// 查询订单详情详细
export function getOrderInfo(id) {
  // id = '837278be924e4be9a458e9965f73c2cc'
  return request({
    url: '/orderInfo/orderInfo/' + id,
    method: 'get'
  })
}
export function getGoodsInfo(id) {
  // id = '837278be924e4be9a458e9965f73c2cc'
  return request({
    url: '/orderGoods/orderGoods/list?orderId=' + id,
    method: 'get'
  })
}
export function getOpretionList(id) {
  // id = '837278be924e4be9a458e9965f73c2cc'
  return request({
    url: '/orderAction/orderAction/list?orderId=' + id,
    method: 'get'
  })
}
// 新增订单详情
export function addOrderInfo(data) {
  return request({
    url: '/orderInfo/orderInfo',
    method: 'post',
    data: data
  })
}

// 修改订单详情
export function updateOrderInfo(data) {
  return request({
    url: '/orderInfo/orderInfo',
    method: 'put',
    data: data
  })
}
// 修改价格
export function updateOrderPrice(data) {
  return request({
    url: '/orderInfo/orderInfo/updateAdminPrice',
    method: 'put',
    data: data
  })
}
// 修改快捷发货
export function updateFastDelivery(data) {
  return request({
    url: '/orderInfo/orderInfo/fastDelivery',
    method: 'put',
    data: data
  })
}
// 修改结算价
export function updateCost(data) {
  return request({
    url: '/orderGoods/orderGoods/updateCost',
    method: 'put',
    data: data
  })
}
// 删除订单详情
export function delOrderInfo(id) {
  return request({
    url: '/orderInfo/orderInfo/' + id,
    method: 'delete'
  })
}

// 导出订单详情
export function exportOrderInfo(query) {
  return request({
    url: '/orderInfo/orderInfo/export',
    method: 'get',
    params: query
  })
}
// 订单状态枚举
export function orderStatusList() {
  return request({
    url: '/system/dict/data/type/SHOP_ORDER_STATUS',
    method: 'get'
  })
}
// 物流信息
export function expressInfo(invoiceNo, expressName) {
  return request({
    url: '/orderInfo/orderInfo/expressInfo?invoiceNo=' + invoiceNo + '&expressName=' + expressName,
    method: 'get'
  })
}